home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / util / pack / xpk_Source.lha / xpk_Source / E / xPipe.e < prev    next >
Text File  |  1998-11-09  |  2KB  |  63 lines

  1. /* $VER: xPipe 1.0 (18-3-97) © Frédéric RODRIGUES freeware
  2.    XPK type utility
  3.  
  4. xPipe: depacks the current input on the current output (usefull to process
  5. files packed or unpacked as they were unpacked.
  6.  
  7. LEGAL STUFF
  8. ~~~~~~~~~~~
  9. xPKE is declared freeware. This is intended for a learning use to
  10. encourage programming of XPK in E. Do whatever you want with the files
  11. but keep all files unchanged and together if you distribute it and
  12. mention my name on your creations if you use it. I would appreciate little
  13. donations for my work (who knows somebody will send me something - please,
  14. send me at least an email).
  15.  
  16. This program is free software; you can redistribute it and/or modify
  17. it under the terms of the GNU General Public License as published by
  18. the Free Software Foundation; either version 2 of the License, or
  19. (at your option) any later version.
  20.  
  21. This program is distributed in the hope that it will be useful,
  22. but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24. GNU General Public License for more details.
  25.  
  26. HOW TO REACH ME ?
  27. ~~~~~~~~~~~~~~~~~
  28. by email : rodrigue@iles.siera.ups-tlse.fr (IP 130.120.84.50)
  29. by mail : Frédéric RODRIGUES
  30.           4 allées Antonio Machado app 3009D
  31.           31100 Toulouse
  32.           FRANCE
  33. */
  34.  
  35. OPT OSVERSION=36
  36.  
  37. MODULE 'xpk/xpk','xpkmaster','utility/tagitem'
  38.  
  39. DEF xpkfib:PTR TO xpkfib,xpkerr[XPKERRMSGSIZE]:STRING,xpkbuf,nbytes
  40.  
  41. PROC main()
  42.   IF xpkbase:=OpenLibrary('xpkmaster.library',2)
  43.     IF XpkOpen({xpkfib},[XPK_INFH,Input(),
  44.                          XPK_GETERROR,xpkerr,
  45.                          XPK_PASSTHRU,TRUE,
  46.                          TAG_DONE])=0
  47.       IF (xpkbuf:=String(xpkfib.nlen))=NIL
  48.         WriteF('cannot allocate memory\n')
  49.       ELSE
  50.         WHILE (nbytes:=XpkRead(xpkfib,xpkbuf,xpkfib.nlen))>0
  51.           Write(Output(),xpkbuf,nbytes)
  52.         ENDWHILE
  53.         IF nbytes<0 THEN WriteF('\s\n',xpkerr)
  54.         XpkClose(xpkfib)
  55.       ENDIF
  56.     ELSE
  57.       WriteF('\s\n',xpkerr)
  58.     ENDIF
  59.   ELSE
  60.     WriteF('cannot open library\n')
  61.   ENDIF
  62. ENDPROC
  63.